package vo;

import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class SwotElementVO {
	
	private int id;
	private String name, perspective, elementType, relevancia, relevanciaExtenso;
	
	public SwotElementVO(){
		this.relevancia = "1";
	}
	
	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setRelevancia(String relevancia) {
		this.relevancia = relevancia;
	}

	public String getRelevancia() {
		return relevancia;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setPerspective(String perspective) {
		this.perspective = perspective;
	}

	public String getPerspective() {
		return perspective;
	}

	public void setElementType(String elementType) {
		this.elementType = elementType;
	}

	public String getElementType() {
		return elementType;
	}
	
	public String getElementTypeExtenso(){
		if (this.elementType.equalsIgnoreCase("S"))
			return "Strength";
		else if (this.elementType.equalsIgnoreCase("W"))
			return "Weakness";
		else if (this.elementType.equalsIgnoreCase("O"))
			return "Opportunity";
		else if (this.elementType.equalsIgnoreCase("T"))
			return "Threat";
		else
			return "";
	}
	
	public List<String> getListPerspectives(){
		List<String> lista = new ArrayList<String>();
		
		StringTokenizer st = new StringTokenizer(this.perspective, ",");
		while(st.hasMoreTokens()){
			String tmp = st.nextToken();
			lista.add(tmp.trim());
		}
		
		return lista;
	}

	public void setRelevanciaExtenso(String relevanciaExtenso) {
		this.relevanciaExtenso = relevanciaExtenso;
	}

	public String getRelevanciaExtenso() {
		return relevanciaExtenso;
	}
}
